Skip to content

fix: align S3 static-website tutorial with sample, fix bucket name and output discrepancies#495

Merged
quetzalliwrites merged 3 commits intomainfrom
harshmishra/doc-113
Apr 27, 2026
Merged

fix: align S3 static-website tutorial with sample, fix bucket name and output discrepancies#495
quetzalliwrites merged 3 commits intomainfrom
harshmishra/doc-113

Conversation

@HarshCasper
Copy link
Copy Markdown
Member

@HarshCasper HarshCasper commented Mar 16, 2026

Fixes DOC-113

Related PR: localstack-samples/localstack-terraform-samples#15

Summary

  • HTML files now live under a www/ subdirectory (matches sample). awslocal s3 sync ./www/ replaces awslocal s3 sync ./ so bucket_policy.json no longer gets uploaded into the bucket.
  • main.tf uses fileset("${path.root}", "www/*.html") to match the sample.
  • Bucket name normalized to testwebsite throughout — the terraform apply example previously used testbucket, which silently broke every command in the Testing section.
  • outputs.tf now prints LocalStack-formatted domain and website_endpoint so users get an openable URL, instead of the misleading AWS-formatted strings (*.s3-website-us-east-1.amazonaws.com) returned by the aws_s3_bucket_website_configuration attributes.
  • Provider config: deprecated comment-URL anchor #s3_force_path_style#s3_use_path_style; added s3control endpoint (required by AWS provider v6 to read bucket tags) with an explanatory note. s3_use_path_style = false retained.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 16, 2026

Deploying localstack-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: d946568
Status: ✅  Deploy successful!
Preview URL: https://e5f43db1.localstack-docs.pages.dev
Branch Preview URL: https://harshmishra-doc-113.localstack-docs.pages.dev

View logs

We can do this by specifying the `endpoints` parameter for each service, that we intend to use.
We can do this by specifying the `endpoints` parameter for each service that we intend to use.

When using LocalStack, set `s3_use_path_style = true` so that S3 requests use path-style URLs, which LocalStack expects for the local endpoint.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi I'm a bit confused here. The original setting of s3_use_path_style = false did work - are you saying true is the more correct setting?

Btw my original reported issue is more the inconsistency between the code examples in our tutorial docs vs that's in our sample repos (e.g. see https://github.com/localstack-samples/localstack-terraform-samples/blob/master/s3-static-website/provider.tf) - it seems to me when we updated tutorial docs the corresponding sample repos is not updated.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mmaureenliu, yes — my apologies! false works and matches the original. I have reverted that now. The sample files (outputs.tf, provider.tf) have now been updated to match the docs.

@HarshCasper HarshCasper changed the title fix: use s3_use_path_style in S3 Terraform tutorial fix: align S3 static-website tutorial with sample, fix bucket name and output discrepancies Apr 27, 2026
@quetzalliwrites quetzalliwrites merged commit 006d27c into main Apr 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants